{include file="public/header" /}

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body ">
                    <ul class="layui-row layui-col-space10 layui-this x-admin-carousel x-admin-backlog">
                        <div class="layui-row layui-col-space10">
                            {foreach $list as $v}
                            <div class="layui-col-md2">
                                <a href="javascript:;" class="x-admin-backlog-body">
                                    <p><cite>{$v.name}统计</cite></p>
                                    <hr />
                                    <div class="layui-row layui-col-space10">
                                        <div class="layui-col-md6">
                                            <button type="button"
                                                class="layui-btn  layui-btn-fluid  layui-btn-normal">发行量:{$v.count}</button>
                                        </div>
                                        <div class="layui-col-md6">
                                            <button type="button"
                                                class="layui-btn  layui-btn-fluid  layui-btn-normal">报销量:{$v.count1}</button>
                                        </div>
                                    </div>
                                    <div class="layui-row layui-col-space10">
                                        <div class="layui-col-md6">
                                            <button type="button"
                                                class="layui-btn  layui-btn-fluid  layui-btn-normal">兑换量:{$v.count2}</button>
                                        </div>
                                        <div class="layui-col-md6">
                                            <button type="button"
                                                class="layui-btn  layui-btn-fluid  layui-btn-normal">现收益量:{$v.count3}</button>
                                        </div>
                                    </div>
                                    <div class="layui-row layui-col-space10">
                                        <div class="layui-col-md6">
                                            <button type="button"
                                                class="layui-btn  layui-btn-fluid  layui-btn-normal">待匹配量:{$v.count4}</button>
                                        </div>
                                        <div class="layui-col-md6">
                                            <button type="button"
                                                class="layui-btn  layui-btn-fluid  layui-btn-normal">匹配中:{$v.count5}</button>
                                        </div>
                                    </div>
                                    <div class="layui-row layui-col-space10">
                                        <div class="layui-col-md6">
                                            <button type="button"
                                                class="layui-btn  layui-btn-fluid  layui-btn-normal">预约量:{$v.count6}</button>
                                        </div>
                                        <div class="layui-col-md6">
                                            <button type="button"
                                                class="layui-btn  layui-btn-fluid  layui-btn-danger">现有:{$v.count7}</button>
                                        </div>
                                    </div>
                                    <div class="layui-row layui-col-space10">
                                        <div class="layui-col-md6">
                                            <button type="button"
                                                class="layui-btn  layui-btn-fluid  layui-btn-normal">今日释放:{$v.count8}</button>
                                        </div>
                                    </div>
                                </a>
                            </div>
                            {/foreach}
                        </div>
                    </ul>
                </div>
            </div>
        </div>
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">
                    共有数据：<strong id="count">{$list->total()}</strong> 条
                </div>
                <div class="layui-card-body layui-table-body layui-table-main">
                    <table class="layui-table layui-form">
                        <thead>
                            <tr>
                                <th>ID</th>
                                <th>名称</th>
                                <th>等级</th>
                                <th>周期</th>
                                <th>最小价</th>
                                <th>最高价</th>
                                <th>日收益（%）</th>
                                <th>预约积分</th>
                                <th>抢购积分</th>
                                <th>图标</th>
                                <th>开始时间</th>
                                <th>结束时间</th>
                                <th>状态</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            {foreach $list as $v}
                            <tr>
                                <td>{$v.id|default='0'}</td>
                                <td>{$v.name|default=''}</td>
                                <td>{$v.level|default=0}</td>
                                <td>{$v.cycle|default=1}</td>
                                <td>{$v.min_price|default=1}</td>
                                <td>{$v.max_price|default=1}</td>
                                <td>{$v.income|default=1}</td>
                                <td>{$v.reserpoints|default=1}</td>
                                <td>{$v.snappoints|default=1}</td>
                                <td><img onclick='showimg("{$v.img}")' src="{$v.img|default=''}" alt="图片"></td>
                                <td>{$v.start_time|default=1}</td>
                                <td>{$v.end_time|default=1}</td>
                                <td>{if $v.status == 1}开启{else}关闭{/if}</td>
                                <td class="td-manage">
                                    <a title="编辑" onclick="data_edit('编辑','/hall/contactliststr?id={$v.id}')"
                                        href="javascript:;" class="layui-btn">
                                        编辑
                                    </a>
                                </td>
                            </tr>
                            {/foreach}

                        </tbody>
                    </table>
                </div>
                <div class="layui-card-body ">
                    <div class="page">
                        {$list->render()|raw}
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>
</body>
<script>
    layui.use(['form', 'upload'], function () {
        var $ = layui.jquery
            , upload = layui.upload;
        //图片上传
        var uploadInst = upload.render({
            elem: '#test1'
            , url: 'users_top'
            , accept: 'file'
            , exts: 'xls|csv'
            , before: function (obj) {
                //预读本地文件示例，不支持ie8
                obj.preview(function (index, file, result) {
                    $('#demo1').attr('src', result); //图片链接（base64）
                });
            }
            , done: function (res) {
                //如果上传失败
                if (res.status > 0) {
                    return layer.msg(res.msg);
                }
                //上传成功
                return layer.msg(res.msg);
            }
            , error: function () {
                //演示失败状态，并实现重传
                var demoText = $('#demoText');
                demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
                demoText.find('.demo-reload').on('click', function () {
                    uploadInst.upload();
                });
            }
        });
    });

    function showimg(imgs) {
        layer.open({
            type: 1,
            title: false,
            shadeClose: true,
            skin: 'layui-layer-nobg', //没有背景色
            content: "<img src='" + imgs + "' style='width:100%;height: 100%;'>"
        });
    }
</script>
{include file="public/footer"}